import { getServerSession } from 'next-auth';
import { redirect } from 'next/navigation';
import { RegisterForm } from './RegisterForm';

export default async function RegisterPage() {
  const session = await getServerSession();
  if (session) {
    redirect('/');
  }

  return (
    <div className="min-h-screen flex items-center justify-center bg-gray-50 py-12 px-4 sm:px-6 lg:px-8">
      <div className="max-w-md w-full space-y-8">
        <div>
          <h2 className="mt-6 text-center text-3xl font-extrabold text-gray-900">
            创建新账号
          </h2>
          <p className="mt-2 text-center text-sm text-gray-600">
            或者{' '}
            <a href="/login" className="font-medium text-blue-600 hover:text-blue-500">
              登录已有账号
            </a>
          </p>
        </div>
        <RegisterForm />
      </div>
    </div>
  );
} 